import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { getHomeBanner } from './home-serv'

export default defineStore('home', {
  state: () => ({
    // 所有这些属性都将自动推断出它们的类型
    count: 0,
  }),
  actions: {
    async getHomeBanner(callback?: (data: any) => void) {
      try {
        const res = await getHomeBanner()
        callback && callback(res)
        return res
      } catch (err: any) {
        console.log(err)
        Promise.reject(err)
      }
    },
  },
})
